package com.dengke.springsecurity.schedule;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class WriteCurrentTimeSchedule {
	private static final DateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss sss");
	
	@Scheduled(fixedDelay=5*1000)
	public void WriteCurrentTime(){
		Date now=new Date();
		String nowString=df.format(now);
		System.out.println("Now is :"+nowString);
	}
}
